package cn.iocoder.yudao.module.trade.controller.admin.order.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.framework.excel.core.convert.MoneyConvert;
import cn.iocoder.yudao.module.product.enums.DictTypeConstants;
import cn.iocoder.yudao.module.trade.enums.ExcelColumnSelectNameConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 交易订单 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class TradeOrderExcelBaseVO {

    // ========== 订单基本信息 ==========

    @Schema(description = "订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty(value = "订单编号", order = 20)
    private Long id;

    @Schema(description = "订单流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1146347329394184195")
    @ExcelProperty(value = "订单流水号", order = 2)
    private String no;

    @Schema(description = "用户备注", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "用户备注", order = 10)
    private String userRemark;

    @Schema(description = "订单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "商品状态", converter = DictConvert.class)
    @DictFormat(DictTypeConstants.TRADE_ORDER_STATUS)
    private Integer status;

    @Schema(description = "购买的商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    @ExcelProperty(value = "商品数量", order = 3)
    private Integer productCount;

    @Schema(description = "付款时间")
    @ExcelProperty(value = "付款时间", order = 19)
    @DateTimeFormat(value = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime payTime;

    @Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx_lite")
    @ExcelProperty(value = "支付渠道", order = 16)
    private String payChannelCode;

    @Schema(description = "应付金额（总）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
    @ExcelProperty(value = "应付金额（总）", order = 3, converter = MoneyConvert.class)
    private Integer payPrice;

    @Schema(description = "发货物流单号", example = "1024")
    @ExcelProperty(value = "发货物流单号", order = 10)
    private String logisticsNo;

    @Schema(description = "收件人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty(value = {"收件人信息", "收件人名称"}, order = 6)
    private String receiverName;

    @Schema(description = "收件人手机", requiredMode = Schema.RequiredMode.REQUIRED, example = "13800138000")
    @ExcelProperty(value = {"收件人信息", "收件人手机"}, order = 7)
    private String receiverMobile;

    @Schema(description = "收件人详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "中关村大街 1 号")
    @ExcelProperty(value = {"收件人信息", "收件人详细地址"}, order = 9)
    private String receiverDetailAddress;

}
